/**
 * UserSvnProject.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table user_svn_project
 * @author Viorel Tacliciu
 * @version 1
 */

@Table(name="user_svn_project")
@Entity
public class  UserSvnProject{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //this attribute maps the foreign key column FK_USER
    private Users fkUser;
    //this attribute maps the foreign key column FK_PROJECT
    private Projects fkProject;
    //this attribute maps the foreign key column FK_SVN
    private Svn fkSvn;
    //end mapping columns

    //define getters and setters with coresponding ejb3 annotation, depending of the type
    //of the relation for the column

    /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * users entity
     * @return - an Users object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_USER",referencedColumnName = "ID")
    public Users getFkUser(){
        return this.fkUser;
    }

    /**
     * This method sets the field fkUser of this entity
     * @param fkUser - an Users object
     **/
    public void setFkUser(Users fkUser){
        this.fkUser=fkUser;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * projects entity
     * @return - an Projects object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT",referencedColumnName = "ID")
    public Projects getFkProject(){
        return this.fkProject;
    }

    /**
     * This method sets the field fkProject of this entity
     * @param fkProject - an Projects object
     **/
    public void setFkProject(Projects fkProject){
        this.fkProject=fkProject;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * svn entity
     * @return - an Svn object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_SVN",referencedColumnName = "ID")
    public Svn getFkSvn(){
        return this.fkSvn;
    }

    /**
     * This method sets the field fkSvn of this entity
     * @param fkSvn - an Svn object
     **/
    public void setFkSvn(Svn fkSvn){
        this.fkSvn=fkSvn;
    }
}



